package com.chuangke.common.utils;

import java.util.Properties;

import com.google.code.kaptcha.Constants;
import com.google.code.kaptcha.Producer;
import com.google.code.kaptcha.util.Config;
import com.google.code.kaptcha.util.Configurable;

public class KaptchaUtils {

    public static String createText(Producer producer,String charLength){
        Properties properties = new Properties() ;
		properties.put(Constants.KAPTCHA_TEXTPRODUCER_CHAR_LENGTH,charLength) ;
		Config config = new Config(properties) ;

		Configurable configurable = (Configurable)producer ;
		configurable.setConfig(config);

        return producer.createText();
    }

}
